﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IFRS.Web;
using IFRS.DataAccess.DAL;
using System.Data;

public partial class IFRS_SEC03_4V : PageBase
{
    #region "---------- Events -----------"
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!(Page.IsPostBack || Page.IsCallback))
        {
            this.ViewMenu();
            this.BindData(Convert.ToInt32(Request.QueryString["id"].ToString()));
        }
        else
            ClientScript.RegisterHiddenField("isPostBack", "1");
    }

    protected void btnCANCEL_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/IFRS/SEC03_1S.aspx");
    }

    #endregion
    #region "----- Methods -------"
    private void ViewMenu()
    {
        this.MenuTitleBar = Resources.ifrsMenu.SEC03_1S;
    }


    private void BindData(int ID)
    {
        var vROLEGROUPUSER = new SPR_ROLEGROUPUSER();
        DataTable dtvROLEGROUPUSER = vROLEGROUPUSER.SEARCH_BYID(ID);

        if (dtvROLEGROUPUSER.Rows.Count > 0)
        {
            txtGroup.Text = dtvROLEGROUPUSER.Rows[0]["RoleGroupName"].ToString();
            txtEmployee_ID.Text = dtvROLEGROUPUSER.Rows[0]["EmployeeCode"].ToString();
            txtEmployee_Name.Text = dtvROLEGROUPUSER.Rows[0]["description"].ToString();
            txtCostCenter.Text = dtvROLEGROUPUSER.Rows[0]["COST_CENTER_NM"].ToString();


            if (dtvROLEGROUPUSER.Rows[0]["IsActive"].ToString().ToLower() == "true")
            {
                rbSTATUS_1.Checked = true;
            }
            else
            {
                rbSTATUS_2.Checked = true;
            }

        }
    }
    #endregion
 
}